package com.aiyige.page.publish.majorcourse.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by zhuyakun on 2017/12/13.
 */

public class ClassLocation implements Parcelable {
    String province;
    String city;
    String id;

    public ClassLocation() {
    }

    private ClassLocation(Builder builder) {
        setProvince(builder.province);
        setCity(builder.city);
        setId(builder.id);
    }

    public static Builder newBuilder() {
        return new Builder();
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public static final class Builder {
        private String province;
        private String city;
        private String id;

        private Builder() {
            province = "";
            city = "";
            id = "";
        }

        public Builder province(String province) {
            this.province = province;
            return this;
        }

        public Builder city(String city) {
            this.city = city;
            return this;
        }

        public Builder id(String id) {
            this.id = id;
            return this;
        }

        public ClassLocation build() {
            return new ClassLocation(this);
        }
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.province);
        dest.writeString(this.city);
        dest.writeString(this.id);
    }

    protected ClassLocation(Parcel in) {
        this.province = in.readString();
        this.city = in.readString();
        this.id = in.readString();
    }

    public static final Creator<ClassLocation> CREATOR = new Creator<ClassLocation>() {
        @Override
        public ClassLocation createFromParcel(Parcel source) {
            return new ClassLocation(source);
        }

        @Override
        public ClassLocation[] newArray(int size) {
            return new ClassLocation[size];
        }
    };
}
